/**
 * OSAmI: Open Source Ambient Intelligence
 * Copyright (C) 2010 Bull S.A.S.
 * Contact: osami-general@osami-commons.org
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 *
 * --------------------------------------------------------------------------
 * $Id: WebOperation.java 231 2010-08-26 16:08:55Z guillaume.sauthier $
 * --------------------------------------------------------------------------
 */


package org.osami.gateway.display.internal.identity;

import java.io.IOException;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * A {@code WebOperation} is ...
 *
 * @author Guillaume Sauthier
 */
public interface WebOperation {

    /**
     * @return the recognized pattern for this operation.
     */
    String getRecognizedPattern();

    /**
     * Execute an operation mapped to a given URL.
     * @param req HttpServletRequest
     * @param resp HttpServletResponse
     * @throws ServletException
     * @throws IOException
     */
    void execute(final HttpServletRequest request,
                 final HttpServletResponse response,
                 final Map<String, String> urlParameters)
            throws ServletException, IOException;
}
